package com.landinfo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * 短信接收人信息
 * Create by wj
 * 2018-09-03
 */
@ApiModel(description = "短信接收人信息 Create by wj 2018-09-03")
@Entity
@Table(name = "sms_receiver")
// @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class SmsReceiver implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 短信接收人
     */
    @ApiModelProperty(value = "短信接收人")
    @Column(name = "receiver")
    private String receiver;

    /**
     * 接收人电话号码
     */
    @ApiModelProperty(value = "接收人电话号码")
    @Column(name = "phone_number")
    private String phoneNumber;

    /**
     * 短信内容
     */
    @ApiModelProperty(value = "短信内容")
    @Column(name = "content", length = 600)
    private String content;

    /**
     * 气象站点
     */
    @ApiModelProperty(value = "气象站点")
    @Column(name = "weather_site")
    private String weatherSite;

    /**
     * 气象参数
     */
    @ApiModelProperty(value = "气象参数")
    @Column(name = "weather_para")
    private String weatherPara;

    /**
     * 水质站点
     */
    @ApiModelProperty(value = "水质站点")
    @Column(name = "water_site")
    private String waterSite;

    /**
     * 水质参数
     */
    @ApiModelProperty(value = "水质参数")
    @Column(name = "water_para")
    private String waterPara;

    /**
     * 发送时间
     */
    @ApiModelProperty(value = "发送时间")
    @Column(name = "send_time")
    private ZonedDateTime sendTime;

    /**
     * 发送频率(小时)
     */
    @ApiModelProperty(value = "发送频率(小时)")
    @Column(name = "send_frequency")
    private Integer sendFrequency;

    /**
     * 超出预警才发送
     */
    @ApiModelProperty(value = "超出预警才发送")
    @Column(name = "send_beyond_warning")
    private Boolean sendBeyondWarning;

    /**
     * 短信类型（定时发送：regularly、超出预警：beyondWarning、设备离线提醒：deviceOffline）
     */
    @ApiModelProperty(value = "短信类型")
    @Column(name = "send_type")
    private String smsType;

    /**
     * 阿里云中短信模板code
     */
    @ApiModelProperty(value = "阿里短信模板标识码")
    @Column(name = "aliSmsTemplateCode")
    private String aliSmsTemplateCode;

    /**
     * 是否启用
     */
    @ApiModelProperty(value = "是否启用")
    @Column(name = "jhi_enable")
    private Boolean enable;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private ZonedDateTime createTime;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getReceiver() {
        return receiver;
    }

    public SmsReceiver receiver(String receiver) {
        this.receiver = receiver;
        return this;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public SmsReceiver phoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
        return this;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getContent() {
        return content;
    }

    public SmsReceiver content(String content) {
        this.content = content;
        return this;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public ZonedDateTime getSendTime() {
        return sendTime;
    }

    public SmsReceiver sendTime(ZonedDateTime sendTime) {
        this.sendTime = sendTime;
        return this;
    }

    public void setSendTime(ZonedDateTime sendTime) {
        this.sendTime = sendTime;
    }

    public Integer getSendFrequency() {
        return sendFrequency;
    }

    public SmsReceiver sendFrequency(Integer sendFrequency) {
        this.sendFrequency = sendFrequency;
        return this;
    }

    public void setSendFrequency(Integer sendFrequency) {
        this.sendFrequency = sendFrequency;
    }

    public Boolean isSendBeyondWarning() {
        return sendBeyondWarning;
    }

    public SmsReceiver sendBeyondWarning(Boolean sendBeyondWarning) {
        this.sendBeyondWarning = sendBeyondWarning;
        return this;
    }

    public void setSendBeyondWarning(Boolean sendBeyondWarning) {
        this.sendBeyondWarning = sendBeyondWarning;
    }

    public Boolean isEnable() {
        return enable;
    }

    public SmsReceiver enable(Boolean enable) {
        this.enable = enable;
        return this;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public ZonedDateTime getCreateTime() {
        return createTime;
    }

    public SmsReceiver createTime(ZonedDateTime createTime) {
        this.createTime = createTime;
        return this;
    }

    public void setCreateTime(ZonedDateTime createTime) {
        this.createTime = createTime;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove


    public String getWeatherSite() {
        return weatherSite;
    }

    public void setWeatherSite(String weatherSite) {
        this.weatherSite = weatherSite;
    }

    public String getWeatherPara() {
        return weatherPara;
    }

    public void setWeatherPara(String weatherPara) {
        this.weatherPara = weatherPara;
    }

    public String getWaterSite() {
        return waterSite;
    }

    public void setWaterSite(String waterSite) {
        this.waterSite = waterSite;
    }

    public String getWaterPara() {
        return waterPara;
    }

    public void setWaterPara(String waterPara) {
        this.waterPara = waterPara;
    }

    public String getSmsType() {
        return smsType;
    }

    public void setSmsType(String smsType) {
        this.smsType = smsType;
    }

    public String getAliSmsTemplateCode() {
        return aliSmsTemplateCode;
    }

    public void setAliSmsTemplateCode(String aliSmsTemplateCode) {
        this.aliSmsTemplateCode = aliSmsTemplateCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SmsReceiver smsReceiver = (SmsReceiver) o;
        if (smsReceiver.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), smsReceiver.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "SmsReceiver{" +
            "id=" + getId() +
            ", receiver='" + getReceiver() + "'" +
            ", phoneNumber='" + getPhoneNumber() + "'" +
            ", content='" + getContent() + "'" +
            ", weatherSite='" + getWeatherSite() + "'" +
            ", weatherPara='" + getWeatherPara() + "'" +
            ", waterSite='" + getWaterSite() + "'" +
            ", waterPara='" + getWaterPara() + "'" +
            ", sendTime='" + getSendTime() + "'" +
            ", sendFrequency=" + getSendFrequency() +
            ", smsType='" + getSmsType() + "'" +
            ", aliSmsTemplateCode='" + getAliSmsTemplateCode() + "'" +
            ", sendBeyondWarning='" + isSendBeyondWarning() + "'" +
            ", enable='" + isEnable() + "'" +
            ", createTime='" + getCreateTime() + "'" +
            "}";
    }

}
